package co.com.inventarios.modelo;

import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Cataventa entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "CATAVENTA", schema = "MANAGER", uniqueConstraints = {})
public class Cataventa implements java.io.Serializable {

	// Fields

	private String catcodigo;
	private String catnombre;
	private Date catfecini;
	private Date catfecfin;
	private Long catactivo;
	private Timestamp catlogfec;
	private Dlluser dlluser;
	private Set<RequiPro> requiPros = new HashSet<RequiPro>(0);
	private Set<Catvtapro> catvtapros = new HashSet<Catvtapro>(0);
	private Set<Mngmcn> mngmcns = new HashSet<Mngmcn>(0);
	private Set<Bodega> bodegas = new HashSet<Bodega>(0);

	// Constructors

	/** default constructor */
	public Cataventa() {
	}

	/** minimal constructor */
	public Cataventa(String catcodigo) {
		this.catcodigo = catcodigo;
	}

	/** full constructor */
	public Cataventa(String catcodigo, String catnombre, Date catfecini,Timestamp catlogfec,
			Date catfecfin, Long catactivo, Set<RequiPro> requiPros,Dlluser dlluser,
			Set<Catvtapro> catvtapros, Set<Mngmcn> mngmcns, Set<Bodega> bodegas) {
		this.catcodigo = catcodigo;
		this.catnombre = catnombre;
		this.catfecini = catfecini;
		this.catlogfec = catlogfec;
		this.dlluser = dlluser;
		this.catfecfin = catfecfin;
		this.catactivo = catactivo;
		this.requiPros = requiPros;
		this.catvtapros = catvtapros;
		this.mngmcns = mngmcns;
		this.bodegas = bodegas;
	}

	// Property accessors
	@Id
	@Column(name = "CATCODIGO", unique = true, nullable = false, insertable = true, updatable = true, length = 5)
	public String getCatcodigo() {
		return this.catcodigo;
	}
	

	public void setCatcodigo(String catcodigo) {
		this.catcodigo = catcodigo;
	}

	@Column(name = "CATNOMBRE", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public String getCatnombre() {
		return this.catnombre;
	}

	public void setCatnombre(String catnombre) {
		this.catnombre = catnombre;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "CATFECINI", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getCatfecini() {
		return this.catfecini;
	}

	public void setCatfecini(Date catfecini) {
		this.catfecini = catfecini;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "CATFECFIN", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getCatfecfin() {
		return this.catfecfin;
	}

	public void setCatfecfin(Date catfecfin) {
		this.catfecfin = catfecfin;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "CATLOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "CATLOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getCatlogfec() {
		return this.catlogfec;
	}

	public void setCatlogfec(Timestamp catlogfec) {
		this.catlogfec = catlogfec;
	}
	
	@Column(name = "CATACTIVO", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getCatactivo() {
		return this.catactivo;
	}

	public void setCatactivo(Long catactivo) {
		this.catactivo = catactivo;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "cataventa")
	public Set<RequiPro> getRequiPros() {
		return this.requiPros;
	}

	public void setRequiPros(Set<RequiPro> requiPros) {
		this.requiPros = requiPros;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "cataventa")
	public Set<Catvtapro> getCatvtapros() {
		return this.catvtapros;
	}

	public void setCatvtapros(Set<Catvtapro> catvtapros) {
		this.catvtapros = catvtapros;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "cataventa")
	public Set<Mngmcn> getMngmcns() {
		return this.mngmcns;
	}

	public void setMngmcns(Set<Mngmcn> mngmcns) {
		this.mngmcns = mngmcns;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "cataventa")
	public Set<Bodega> getBodegas() {
		return this.bodegas;
	}

	public void setBodegas(Set<Bodega> bodegas) {
		this.bodegas = bodegas;
	}

}